package com.itheima.pojo;

import java.util.Objects;

public class Account {
    private Integer id;
    private String name;
    private Double money;

    public Account() {
    }

    public Account(Integer id, String name, Double money) {

        this.id = id;
        this.name = name;
        this.money = money;
    }

    public Integer getId() {

        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    @Override

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Account account = (Account) o;
        return Objects.equals(id, account.id) &&
                Objects.equals(name, account.name) &&
                Objects.equals(money, account.money);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, name, money);
    }


     /*@Override
         public String toString() {
         return "Account{" +
         "id=" + id +
         ", name='" + name + '\'' +
         ", money=" + money +
         '}';
         }*/

     public void init() {
         System.out.println("account对象初始化");
     }

     public void destroy() {
         System.out.println("account对象销毁");
     }

}
